<template>
  <div class="tree">
    <el-tree
      ref="tree"
      :data="personnelData"
      default-expand-all
      highlight-current
      :show-checkbox="true"
      node-key="id"
      @check="selectChange"
      :append-to-body='true'
    />
  </div>
</template>

<script>
import { getsearch } from '@/api/uc/search'


export default {
  props: ['review','personnelData'],
  name: 'selectPersonnelTree',
  data() {
    return {
      reviewData: []
    }
  },
  mounted() {
    console.log(this.personnelData,'personnelData');
    // this.getSearch()
  },
  methods: {
    // 获取数据
    // async getSearch() {
    //     let data = await getsearch()
    //     this.reviewData = data.data.groupUserTree
    // },
    selectChange() {
      let reviews = this.$refs.tree.getCheckedNodes()
      let review = reviews.filter((item) => {
        if (item.person) {
          return item
        }
      })
      this.$emit('update:review', review)
    }
  }
}
</script>

<style scoped>
</style>
